package net.lzzy.practices.repositories;

import net.lzzy.practices.entities.Applicant;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;
import java.util.UUID;

public interface ApplicantRepository extends JpaRepository<Applicant, UUID> {
    /**根据学生用户id获取其所有的申请，并按申请时间降序*/
    List<Applicant> findApplicantsByStudentIdEqualsAndStatusEqualsOrderByApplyTimeDesc(UUID id, int status);
    /**task teacher*/
    Applicant findApplicantByCourseIdAndStudentId(UUID courseId, UUID studentId);

    /**根据学生用户id及申请的状态获取相应状态的申请，并按申请时间降序*/
    List<Applicant> findApplicantsByCourseIdEqualsAndStatusEqualsOrderByApplyTimeDesc(UUID id, int status);
}
